﻿{template admin/head}
<link rel="stylesheet" type="text/css" href="{STATICDIR}admin/css/login.css"/>
<body class="login_body">
<div class="login_box">
	<form id='rootlogin' method="post">
		<input type='hidden' name='submits' value='1'>
		<div class="login">
			<div class="l_top">
				<img style="width: 93px;height: 57px;" src="{STATICDIR}admin/images/logo.png">
				<p><span>登录伏蒙管理后台</span></p>
			</div>
			<div class="l_bottom">
				<p><span>用户名：</span><input type="text" placeholder="请输入登录的名称" data-type="1" name="username" value="{$username}" class="text w260" ></p>
				<p><span>密码：</span><input type="password" placeholder="请输入登录的密码" data-type="1" name="password" value="" placehold="请输入密码" class="text w260"></p>
				<p class="yz"><span>验证码：</span><input type="text" placeholder="请输入右侧验证码" data-type="1" id='scode' name="seccode" class="text w150"><!--<u><img style="cursor: pointer;" onclick="this.src='{SITE_URL}admin.php?a=seccode&d='+Math.random()" src="{SITE_URL}admin.php?a=seccode"></u>--></p>
				<a href="javascript:;" onclick="dologin()">登录</a>
			</div>
		</div>
	</form>
</div>
<script>
	function dologin()
	{
          
		var data = $("#rootlogin").serialize();
		
		var bool = submitcheck();
		if(!bool)
		{
			return;
		}
		
		var url = '{SITE_URL}ajax/admin.php?m=login';
		
      	var callback = function(data)
        {
 
            if(data.sign == 1)
            {
            	window.location = '{SITE_URL}admin.php';
            }
            else
            {
                if(data.msg)
                {
                    layer.msg(data.msg);
                }
                else
                {
                    layer.msg('操作失败');
                }

            }
        };
makeAjax
        makeAjax('post',url,data,callback);
	}
	
	$("#scode").bind('keyup',function(event) {  
	    if(event.keyCode==13){  
	    	dologin();
	    }     
	});
	
</script>
{template admin/foot}